import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'

export const routes = [
  {
    path: '/',
    name: 'childHome',
    redirect: '/app1',
    children: [
      {
        path: '/app1',
        name: '页面1',
        component: () => import('@/views/app1.vue')
      },
      {
        path: '/app2',
        name: '页面2',
        component: () => import('@/views/app2.vue')
      }
    ]
  },
]

export const history = createWebHistory(`${window.__MICRO_APP_BASE_ROUTE__ || import.meta.env.VITE_APP_CONTEXT_PATH || ''}`)

const router = createRouter({
  history: history,
  routes: routes
})

export default router;